package cn.e2win.biz.dbo;

import java.math.BigDecimal;

import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

import cn.e2win.base.entity.BaseApproveI;
import cn.e2win.base.entity.BaseEntity;

@MappedSuperclass
public abstract class BaseOrg extends BaseEntity  implements BaseApproveI{

		

	/**
	 * 
	 */
	private static final long serialVersionUID = -1352029076899395705L;

	private Integer areaId;//区，保存在dict表中

	private Integer adminUserId;//专管员ID
	private Integer adminUserId2;//专管员2ID
	private String orgName;//组织名称 
	private String address;//地址	经纬度位标
	private BigDecimal x;
	private BigDecimal y;
	

	//以上内容为前端展示内容
	private String contact;
	private String fax;
	private String tel;
	private String email;
	private String http;
	private String wx;//微信
	private String wxCode;//微信二唯码
	
	
	
	private String approveStatus="UNSUBMIT";//审核状态 默认为未提交
	@Transient
	private String approveDesc;//审核说明
	
	

	public Notice getApproveNotice(){
		Notice notice = new Notice();
		String msg = "";
		//提交审核时，发消息给adminUserId
		if("SUBMITED".equals(this.getApproveStatus())){
			notice.setToUserId(this.getAdminUserId());
			msg = this.getClass().getSimpleName() + " 【" + this.getOrgName() + "】 已提交审核，需要您的审核，请知晓！" ;
		}else if("APPROVED".equals(this.getApproveStatus()) || "REJECTED".equals(this.getApproveStatus())) {
			
			notice.setToUserId(this.getCreateById());
			if("APPROVED".equals(this.getApproveStatus())){
				msg = this.getClass().getSimpleName() + " 【" + this.getOrgName() + "】 已被审核通过，请知晓！";  
			}else if("REJECTED".equals(this.getApproveStatus())){
				msg = this.getClass().getSimpleName() + " 【" + this.getOrgName() + "】 已被审核驳回，请知晓！";
				
			}
			
		}
		notice.setNoticeType("APPROVE");
		notice.setNoticeDesc(msg);
		return notice;
	}


	public Integer getAreaId() {
		return areaId;
	}

	public void setAreaId(Integer areaId) {
		this.areaId = areaId;
	}

	public Integer getAdminUserId() {
		return adminUserId;
	}

	public void setAdminUserId(Integer adminUserId) {
		this.adminUserId = adminUserId;
	}

	public Integer getAdminUserId2() {
		return adminUserId2;
	}
	public void setAdminUserId2(Integer adminUserId2) {
		this.adminUserId2 = adminUserId2;
	}
	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public BigDecimal getX() {
		return x;
	}

	public void setX(BigDecimal x) {
		this.x = x;
	}

	public BigDecimal getY() {
		return y;
	}

	public void setY(BigDecimal y) {
		this.y = y;
	}

	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getHttp() {
		return http;
	}

	public void setHttp(String http) {
		this.http = http;
	}

	public String getWx() {
		return wx;
	}

	public void setWx(String wx) {
		this.wx = wx;
	}

	public String getWxCode() {
		return wxCode;
	}

	public void setWxCode(String wxCode) {
		this.wxCode = wxCode;
	}

	public String getApproveStatus() {
		return approveStatus;
	}

	public void setApproveStatus(String approveStatus) {
		this.approveStatus = approveStatus;
	}

	public String getApproveDesc() {
		return approveDesc;
	}

	public void setApproveDesc(String approveDesc) {
		this.approveDesc = approveDesc;
	}

	public String getEntityNo(){
		return orgName;
	}	
}
